package com.lfs.dispatcher.feign;

import com.lfs.interfaces.dto.ResultReturn;
import com.lfs.interfaces.model.NotifyModel;
import com.lfs.interfaces.model.dto.OrderDto;
import com.lfs.interfaces.model.vo.ChargeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name="lfs-adapter")
public interface AdapterFeignService {

    /**
     * 调用适配器服务提交订单到上游
     * @param orderDto
     * @return
     */
    @RequestMapping(value = "gameOrder/submitOrder", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultReturn<ChargeVo> submitOrder(@RequestBody OrderDto orderDto);

    /**
     * 调用适配器服务发送回调给下游
     * @param notifyModel
     * @return
     */
    @RequestMapping(value = "gameOrder/notify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public String notify(@RequestBody NotifyModel notifyModel);
}
